const Editor = require('../../../src/index');
const Util = Editor.Util;
const dom = document.createElement('div');
// const expect = require('chai').expect;
const data = require('../../../demos/data/sample.json');
document.body.appendChild(dom);
describe('itempanel test', () => {
  const editor = new Editor();
  const dom = Util.createDOM(`
    <div>
      <div id="page"></div>
      <div id="itempanel">
        <button data-type="node" data-shape="circle" class="geItem">圆形</button>
        <button data-type="node" data-shape="rect" class="geItem">矩形</button>
      </div>
    </div>
  `);
  document.body.appendChild(dom);
  const itempanel = new Editor.Itempanel({
    container: 'itempanel',
    width: 120,
    height: 120
  });
  const page = new Editor.Flow({
    graph: {
      container: 'page',
      height: 500,
      width: 500
    }
  });
  page.read(data);
  editor.add(page);
  editor.add(itempanel);
  it('init', () => {
    editor.destroy();
    dom.destroy();
  });
});
